package com.kylin.common.datascope.context;

/**
 * 数据权限上下文
 * @author wuhao
 * @version 1.0 - 2023/3/29
 */
public class DataScopeHolder {

    private static final ThreadLocal<String> dataScopeSql = new ThreadLocal<>();

    /** 设置线程变量 */
    public static void setContext(String sql) {
        dataScopeSql.set(sql);
    }

    /** 获取线程变量 */
    public static String getContext() {
        return dataScopeSql.get();
    }

    /** 移除线程变量 */
    public static void remove() {
        dataScopeSql.remove();
    }
}
